package
{
	import flare.display.RectSprite;
	import flare.display.TextSprite;

	public class Sentence extends RectSprite
	{
		public var theText:TextSprite;
		public var text:String;
		public static var SIDE_MARGIN:Number = 3;
		
		public function Sentence(x:Number=0, y:Number=0, w:Number=0, h:Number=0, cw:Number=0, ch:Number=0)
		{
			super(x, y, w, h, cw, ch);
			text = "";
			theText = new TextSprite(text);
			theText.x = SIDE_MARGIN;
			theText.y = 5;
			theText.bold = true;
			theText.size = 12.5;
			this.addChild(theText);
			
		}
		
		public function updateSprite():void
		{
			theText.text = text;
		}
		
		public function updateText(newText:String):void
		{
			if(newText != text)
			{
				text = newText;
				updateSprite();
			}
		}
		
	}
}